//
//  DYMemberBillView.m
//  kafuMerchant
//
//  Created by 帝云科技 on 2018/9/20.
//  Copyright © 2018年 帝云科技. All rights reserved.
//

#import "DYMemberBillView.h"

@implementation DYMemberBillView

-(instancetype)initWithFrame:(CGRect)frame
{
    if (self=[super initWithFrame:frame]) {
        [self initView];
    }
    return self;
}
-(void)initView
{
    UIView *line=[[UIView alloc]initWithFrame:CGRectMake(0, 0, kScreenWidth, BILIHEIGHT(10))];
    line.backgroundColor=[UIColor xhq_grayblue];
    [self addSubview:line];
    
    self.backgroundColor=WhiteColor;
    NSArray *array=@[@"充值次数",@"充值金额",@"消费次数",@"消费金额"];
    NSArray *colorArray=@[[UIColor xhq_base],[UIColor xhq_red],[UIColor xhq_base],[UIColor xhq_red]];
    for (NSInteger i=0; i<4; i++) {
        UILabel *titleLabel=[Utils labelWithTitle:array[i] titleFontSize:14 textColor:[UIColor xhq_content] backgroundColor:WhiteColor alignment:1];
        [self addSubview:titleLabel];
        
        UILabel *contentLabel=[Utils labelWithTitle:@"12元" titleFontSize:15 textColor:colorArray[i] backgroundColor:WhiteColor alignment:1];
        [self addSubview:contentLabel];
        
        [titleLabel makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self).offset(i*kScreenWidth/4);
            make.top.equalTo(BILIHEIGHT(23));
            make.width.equalTo(kScreenWidth/4);
        }];
        
        [contentLabel makeConstraints:^(MASConstraintMaker *make) {
            make.centerX.equalTo(titleLabel);
            make.top.equalTo(titleLabel.bottom).offset(BILIHEIGHT(10));
        }];
    }
    
    
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
